﻿using System;
using Xoohoo.Models;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;
using Xoohoo.ModelValidation.Attributes;

namespace Xoohoo.Modules.CMS.Models
{
    public class CategoryInput
    {
        [Guid(ErrorMessage = "栏目ID格式错误")]
        [DisplayName("栏目ID")]
        public Guid? CategoryID { get; set; }

        [Guid(ErrorMessage = "所属栏目ID格式错误")]
        [DisplayName("所属栏目")]
        public Guid? ParentID { get; set; }

        [Required(ErrorMessage = "栏目名称不能为空")]
        [StringLength(50, ErrorMessage = "栏目名称请保持在50个字符以内")]
        [SlugWithChinese(ErrorMessage = "栏目名称只能包含中文、字母、数字、_和-,并且必须以字母或中文开头")]
        [DisplayName("栏目名称")]
        public string CategoryName { get; set; }

        [DisplayName("栏目简介")]
        public string CategoryIntro { get; set; }

        [DisplayName("栏目详情")]
        public string CategoryDetail { get; set; }

        [DisplayName("栏目图片地址")]
        [StringLength(200, ErrorMessage = "栏目图片地址请保持在200个字符以内")]
        public string CategoryImageUrl { get; set; }

        [DisplayName("分类模式")]
        public CategoryMode Mode { get; set; }

        [StringLength(200, ErrorMessage = "链接地址请保持在200个字符以内")]
        [DisplayName("跳转地址")]
        public string Url { get; set; }

        [DisplayName("是否推荐")]
        public bool IsCommend { get; set; }

        [DisplayName("是否审核")]
        public bool IsAuditing { get; set; }

        [DisplayName("是否允许评论")]
        public bool AllowComment { get; set; }

        [StringLength(200, ErrorMessage = "友好地址请保持在200个字符之内")]
        [DisplayName("友好地址")]
        public string EntityName { get; set; }

        [StringLength(200, ErrorMessage = "Meta关键字请保持在200个字符之内")]
        [DisplayName("Meta关键字")]
        public string Keywords { get; set; }

        [StringLength(500, ErrorMessage = "Meta描述请保持在500个字符之内")]
        [DisplayName("Meta描述")]
        public string Description { get; set; }


    }
}
